package com.zoo.diannaopeijian.controller;

import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by zx583 on 2018-01-01.
 */
public class BaseController {
    protected final static String success = "success";
    protected final static String fail = "fail";

    protected final static String rowsWord = "rows";
    protected final static String totalWord = "total";

    public Map buildPageResult(List datas) {
        Map<String, Object> result = new HashMap<>();

        result.put(rowsWord, datas);
        result.put(totalWord, new PageInfo<>(datas).getTotal());

        return result;
    }

    public boolean isLogin() {
        return false;
    }

    public Integer getLoginId() {
        return 1;
    }
}
